package cc.qiblogs.news.ui.presenter;


import java.util.List;

import cc.qiblogs.news.bean.Data;
import cc.qiblogs.news.common.baserx.RxSubscriber;
import cc.qiblogs.news.ui.contract.NewsContract;

/**
 * Created by qihuang on 16-11-5.
 */

public class NewsPresenter extends NewsContract.Presenter {
    public NewsPresenter(NewsContract.View view, NewsContract.Model model) {
        super(view, model);
    }

    @Override
    public void getChannelList(String type) {
        rxManager.add(mModel.getChannelList(type).subscribe(new RxSubscriber<List<Data>>(mContext) {
            @Override
            protected void _onNext(List<Data> dataList) {
                mView.returnChannelList(dataList);
                mView.finishLoading();
            }
        }));
    }

}
